package cn.java.exercises;

public class Factorial
{
    public static void main(String[] args)
    {
        int nSum=0,nValue;
        for (int i = 1; i <= 20; i++)
        {
            nValue=1;
            for (int j = 1; j <= i; j++)
            {
                nValue*=j;
            }
            nSum+=nValue;
        }
        System.out.println(nSum);
    }
}
